import { UserConfig } from 'vitepress';
import renderPermaLink from './render-perma-link';
import MarkDownItCustomAnchor from './markdown-it-custom-anchor';

const config: UserConfig = {
  title: '前端文档',
  description: '前端模板相关文档',
  themeConfig: {
    nav: [
      { text: '工作流', link: '/work-flow/index' },
      {
        text: '插件',
        items: [
          {
            link: '/template-plugin/index',
            text: '远程运行时插件',
          }
        ]
      },
    ],
    sidebar: {
      '/work-flow/': [
        {
          items: [{ text: '描述', link: '/work-flow/index' }],
        },
      ],
    },
    docFooter: {
      prev: '上一页',
      next: '下一页',
    },
  },
  markdown: {
    anchor: {
      permalink: renderPermaLink,
    },
    config: md => {
      md.use(MarkDownItCustomAnchor);
    },
  },
};

export default config;
